package com.wsp.apimanagement.service;

import com.wsp.apimanagement.pojo.dto.Result;
import com.wsp.apimanagement.pojo.entity.Comment;
import com.wsp.apimanagement.pojo.entity.Record;
import com.wsp.apimanagement.pojo.vo.ModuleRecord;
import com.wsp.apimanagement.pojo.vo.RecordInfo;

import javax.validation.constraints.NotNull;
import java.io.BufferedInputStream;
import java.util.List;

/**
 * Package: com.wsp.apimanagement.service
 * Description： TODO
 *
 * @Author: 巫思平
 * Copyright: Copyright (c) 2020
 * Version: 1
 */
public interface RecordService {

    /**
     * 点赞打卡
     * @param userId 点赞者id
     * @param recordId 打卡记录id
     * @return
     */
    Result<Integer> likeRecord(@NotNull String userId, @NotNull String recordId);

    /**
     * 发布打卡
     * @param moduleId
     * @param userId
     * @param recordContent
     * @param file
     * @param filename
     * @return
     */
    Result<Record> putRecord(long moduleId, long userId, String recordContent, BufferedInputStream file, String filename);

    /**
     * 发布打卡（不带照片）
     * @param moduleId
     * @param userId
     * @param recordContent
     * @return
     */
    Result<Record> putRecordWithoutImg(long moduleId, long userId, String recordContent);

    /**
     * 通过用户id查找打卡记录
     * @param userId
     * @param moduleId
     * @param currentPage
     * @return
     */
    Result<List<Record>> findRecordListByUserId(long userId, long moduleId, int currentPage);

    /**
     * 发表评论
     * @param comment
     * @return
     */
    Result<?> putComment(Comment comment);

    /**
     * 获取打卡记录详细信息
     * @param recordId
     * @return
     */
    Result<RecordInfo> getRecordInfo(long recordId, long userId);
}
